home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Sun Solutions 2000 #2
/
Sun Solutions CD (Volume 2 2000)(Special Focus - Java Technologies)(Disc 1).ISO
/
products
/
bin
/
java2
/
Solaris_2
/
bin
/
policytool
< prev
next >
Wrap
Text File
|
2000-01-05
|
3KB
|
121 lines
#!/bin/ksh -p
#
# @(#)java_wrapper.sh 1.50 98/09/15
#
# Copyright 1994-1998 by Sun Microsystems, Inc.,
# 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
# All rights reserved.
#
# This software is the confidential and proprietary information
# of Sun Microsystems, Inc. ("Confidential Information"). You
# shall not disclose such Confidential Information and shall use
# it only in accordance with the terms of the license agreement
# you entered into with Sun.
#
#===================================================================
# THIS SCRIPT AND JAVA WILL NOT RUN UNDER SUNOS4.X, AKA SOLARIS 1.X.
#===================================================================
PRG=`whence $0` >/dev/null 2>&1
progname=`/usr/bin/basename $0`
proc=`/usr/bin/uname -p`
APPHOME=`/usr/bin/dirname "$PRG"`/..
# Resolve symlinks. See 4152645.
while [ -h "$PRG" ]; do
ls=`/usr/bin/ls -ld "$PRG"`
link=`/usr/bin/expr "$ls" : '^.*-> \(.*\)$'`
if /usr/bin/expr "$link" : '^/' > /dev/null; then
prg="$link"
else
prg="`/usr/bin/dirname $PRG`/$link"
fi
PRG=`whence "$prg"` > /dev/null 2>&1
APPHOME=`/usr/bin/dirname "$PRG"`/..
done
JREHOME=$APPHOME/jre
# Where is JRE?
unset jre
if [ -f "${JREHOME}/lib/${proc}/libjava.so" ]; then
jre="${JREHOME}"
fi
if [ -f "${APPHOME}/lib/${proc}/libjava.so" ]; then
jre="${APPHOME}"
fi
if [ "x${jre}" = "x" ]; then
echo "Error: can't find libjava.so."
exit 1
fi
# Select vm type (if classic vm, also select thread type).
unset vmtype
unset ttype
DEFAULT_THREADS_FLAGS=green
if [ "x$1" = "x-hotspot" ]; then
vmtype=hotspot
ttype=native_threads
shift 1
else
if [ "x$1" = "x-classic" ]; then
vmtype=classic
ttype=${DEFAULT_THREADS_FLAGS}_threads
shift 1
else
if [ "x$1" = "x-green" ]; then
vmtype=classic
ttype=green_threads
shift 1
else
if [ "x$1" = "x-native" ]; then
vmtype=classic
ttype=native_threads
shift 1
else
if [ -d ${jre}/lib/${proc}/hotspot ]; then
vmtype=hotspot
ttype=native_threads
else
vmtype=classic
if [[ ${THREADS_FLAG:-${DEFAULT_THREADS_FLAG}} = native ]]
then
ttype=native_threads
else
ttype=green_threads
fi
fi
fi
fi
fi
fi
# Special handling for classic VM.
if [ "${vmtype}" = "classic" ]; then
# fix for bug 4032715
if [[ ${ttype} = green_threads ]] ; then
LD_BIND_NOW=yes
export LD_BIND_NOW
fi
# For internal use by classic VM.
_JVM_THREADS_TYPE="${ttype}"
export _JVM_THREADS_TYPE
fi
# Set LD_LIBRARY_PATH for hotspot VM.
LD_LIBRARY_PATH="${jre}/lib/${proc}/${ttype}:${jre}/lib/${proc}/${vmtype}:${jre}/lib/${proc}:$LD_LIBRARY_PATH"
export LD_LIBRARY_PATH
prog="$APPHOME/bin/${proc}/${ttype}/${progname}"
# Run.
if [ -x "$prog" ]
then
exec $DEBUG_PROG "$prog" "$@"
else
echo >&2 "$progname was not found in ${prog}"
exit 1
fi